﻿using CID.Domain.Infrastructure;

namespace CID.Web.Models.Infrastructure
{
    public class PackageViewModel : BaseViewModel<IPackage>
    {
        public string PackageType { get; set; }
        public string Comment { get; set; }
        public bool IsActive { get; set; }

        public PackageViewModel() : base() { }
        
        public PackageViewModel(IPackage model) : base(model) 
        {
            PackageType = model.Type.Name;
            Comment = model.Comment;
            IsActive = model.Id.Equals(model.Version.ActivePackage.Id);
        }
    }
}